<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
	<head>
		<link rel="stylesheet" href="<c:url value="css/bootstrap.css" /> " >
		<link rel="stylesheet" href="<c:url value="css/bootstrap-theme.css" /> ">
		<link rel="stylesheet" href="<c:url value="css/carousel.css" />" >
		<script type="text/javascript" src="<c:url value="js/jquery-2.1.1.js" /> "></script>
		<script type="text/javascript" src="<c:url value="js/bootstrap.js" /> "></script>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Home Page</title>
	</head>
	<body>
		<div class="container">
			 <!-- Static navbar -->
	      <div class="navbar navbar-default" role="navigation">
	        <div class="container-fluid">
	          <div class="navbar-header">
	            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
	              <span class="sr-only">Toggle navigation</span>
	              <span class="icon-bar"></span>
	              <span class="icon-bar"></span>
	              <span class="icon-bar"></span>
	            </button>
	            <a class="navbar-brand" href="index.jsp">JSP Servlet</a>
	          </div>
	          <div class="navbar-collapse collapse">
	            <ul class="nav navbar-nav">
	              <li class="active"><a href="index.jsp">Home</a></li>
	              <% if(session.getAttribute("username") != null) { %>
	              <li><a>Welcome <%= session.getAttribute("username") %></a></li>
	              <% } %>
	              <% if(session.getAttribute("username") != null) { %>
	              <li><a href="<c:url value="/profile" /> ">Profile</a></li>
	              <% } %>
	              <% if(session.getAttribute("username") != null) {
	            	  if(session.getAttribute("username").equals("admin")) {
	              %>
	              <li><a href="<c:url value="/listUser" />">List User</a></li>
	              <% } } %>
	              <li><a href="register.jsp">Register</a></li>
	              <% if(session.getAttribute("username") == null) { %>
	              <li><a href="login.jsp">Login</a></li>
	              <% } %>
	              <% if(session.getAttribute("username") != null) { %>
	              <li><a href="upload.jsp">Upload</a></li>
	              <% } %>
	              <% if(session.getAttribute("username") != null) { %>
	              <li><a href="<c:url value="/download" />">Download</a></li>
	              <% } %>
	              <% if(session.getAttribute("username") != null) { %>
	              <li><a href="<c:url value="/history" />">Your History</a></li>
	              <% } %>
	              <% if(session.getAttribute("username") != null) { %>
	              <li><a href="<c:url value="/logoutServlet" />">Logout</a></li>
	              <% } %>
	            </ul>
	          </div><!--/.nav-collapse -->
	        </div><!--/.container-fluid -->
	      </div>  <!-- End navbar -->
	      
	      </div>  <!-- End Container -->
	      <div class="container">
	      
	       <!-- Carousel
		    ================================================== -->
		    <div id="myCarousel" class="carousel slide" data-ride="carousel">
		      <!-- Indicators -->
		      <ol class="carousel-indicators">
		        <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
		        <li data-target="#myCarousel" data-slide-to="1"></li>
		        <li data-target="#myCarousel" data-slide-to="2"></li>
		      </ol>
		      <div class="carousel-inner">
		        <div class="item active">
		          <img src="<c:url value="/image/topbanner1.jpg" />" alt="First slide">
		          <div class="container">
		            <div class="carousel-caption">
		              <h1>Example headline.</h1>
		              <p>Note: If you're viewing this page via a <code>file://</code> URL, the "next" and "previous" Glyphicon buttons on the left and right might not load/display properly due to web browser security rules.</p>
		              <p><a class="btn btn-lg btn-primary" href="#" role="button">Sign up today</a></p>
		            </div>
		          </div>
		        </div>
		        <div class="item">
		          <img src="<c:url value="/image/topbanner2.jpg" />" alt="Second slide">
		          <div class="container">
		            <div class="carousel-caption">
		              <h1>Another example headline.</h1>
		              <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
		              <p><a class="btn btn-lg btn-primary" href="#" role="button">Learn more</a></p>
		            </div>
		          </div>
		        </div>
		        <div class="item">
		          <img src="<c:url value="/image/topbanner3.jpg" />" alt="Third slide">
		          <div class="container">
		            <div class="carousel-caption">
		              <h1>One more for good measure.</h1>
		              <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
		              <p><a class="btn btn-lg btn-primary" href="#" role="button">Browse gallery</a></p>
		            </div>
		          </div>
		        </div>
		      </div>
		      <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
		      <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
		    </div><!-- /.carousel -->
    
	      <div class="bs-callout bs-callout-info">
			  <h4>This is my home page</h4>
			  You can add more picture here.
		  </div>
	
		  <c:if test="${not empty messageLoginSuccess}">
		  	<div class="bs-callout bs-callout-success">
			  <h4>${messageLoginSuccess}</h4>
			  You can change password if the first time login
		  </div>
		  </c:if>
		  
		  <c:if test="${not empty messageRegisterSuccess}">
		  	<div class="bs-callout bs-callout-success">
			  <h4>${messageRegisterSuccess}</h4>
			  You can login to website
		  </div>
		  </c:if>
		  
		  </div>
		 
		<div class="container">
				<div class="navbar navbar-default navbar-fixed-bottom">
		 		<div  class="container">
		        <p class="navbar-text">&copy; Hai Nguyen| Java Fresher</p>
		        <a href="#" class="navbar-btn  btn btn-danger pull-right"><span class="glyphicon glyphicon-chevron-up"></span> Back To Top</a>
		 		</div>
				</div>
			</div>
	</body>
</html>